﻿using UnityEngine;

namespace YPBox
{
    public static class TransformExtention
    {
        /// <summary>
        /// 销毁所有子物体
        /// </summary>
        /// <param name="target"></param>
        public static void ClearChilds(this Transform target)
        {
            for (int i = 0; i < target.childCount; i++)
            {
                GameObject.Destroy(target.GetChild(i).gameObject);
            }
        }
    }
}
